import Svg from './Svg.vue';
import Drawer from './Drawer.vue';
import NumberScrolling from './NumberScrolling.vue';
import type { App, Component } from 'vue';
//引入UI的图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
//解构成 key value的对象
const components: { [name: string]: Component } = { Svg, Drawer, NumberScrolling };

//自动化全局注册
export default {
  install(app: App) {
    Object.keys(components).forEach((key: string) => {
      app.component(key, components[key]);
    });
    //注册
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  }
};
